﻿using Pvax.Data;

namespace Pvax.Data.Tests
{
    /// <summary>
    /// The optimized version of the <see cref="Phone"/>. Suports "new" and "dirty" flags.
    /// </summary>
    /// <remarks>
    /// The class' properties do not raise <c>PropertyChanging</c> events. The tests should
    /// give te same results as the <see cref="Phone"/> class tests.
    /// </remarks>
    public class OptimizedPhone: DbStoreable<long>
    {
        long personId;

        public long PersonId
        {
            get
            {
                return personId;
            }
            set
            {
                if(personId != value)
                {
                    personId = value;
                    OnPropertyChanged("PersonId");
                }
            }
        }

        int countryCode;

        public int CountryCode
        {
            get
            {
                return countryCode;
            }
            set
            {
                if(countryCode != value)
                {
                    countryCode = value;
                    OnPropertyChanged("CountryCode");
                }
            }
        }

        int areaCode;

        public int AreaCode
        {
            get
            {
                return areaCode;
            }
            set
            {
                if(areaCode != value)
                {
                    areaCode = value;
                    OnPropertyChanged("AreaCode");
                }
            }
        }

        string number;

        public string Number
        {
            get
            {
                return number;
            }
            set
            {
                if(number != value)
                {
                    number = value;
                    OnPropertyChanged("Number");
                }
            }
        }
    }
}
